//
// Created by ade on 2022/10/25.
//
#include <queue>
#include <vector>

using namespace std;

class Solution {
public:
    vector<bool> prefixesDivBy5(vector<int> &nums) {
        int len = nums.size();
        vector<bool> res(len, false);
        int val = 0;
        for (int i = 0; i < len; i++) {
            val = (val * 2 + nums[i]) % 5;
            res[i] = val == 0;
        }
        return res;
    }
};